package arithmetic;

public class CalculationFactory {
	
	  public Calculation getOperation(char operator){  
//		  
//		  //if
//	      if(operator == '+'){
//	         return new Addition();
//	      } else if(operator == '-'){
//	         return new Subtraction();
//	      } else if(operator == '*'){
//	         return new Multiplication();
//	      }else if(operator == '/'){
//		     return new Division();
//		  }else {
//	      return new Error();
//	   }
		  
	  //switch
		  switch(operator) 
		 { 
			  case '+': 
				  return new Addition(); 
			  case '-': 
				  return new Subtraction();
			  case '*': 
				  return new Multiplication();
			  case '/': 
				  return new Division();
			  default: 
				  return new Error();
		  } 

}
}
